﻿using System;
using Common.Enums;

namespace Common.Attributes
{
    /// <summary>
    /// 组件属性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = false)]
    public class ComponentAttribute : Attribute
    {
        /// <summary>
        /// 服务声明周期 默认值 Singleton
        /// </summary>
        public LifeTime Lifetime { get; set; } = LifeTime.Singleton;

        /// <summary>
        /// 指定服务类型
        /// </summary>
        public Type ServiceType { get; set; }

        /// <summary>
        /// 是否可以从第一个接口获取服务类型
        /// </summary>
        public bool InterfaceServiceType { get; set; }
    }
}